#ifndef WINDOW_H_
#define WINDOW_H_

#include "SDL/SDL.h"
#include "SDL/SDL_OpenGL.h"

#include "../Graphics/FreeType.h"

using namespace std;

/**
 * Summary: A window to display stuff in
 */
class Window {
	public:
		/**
		 * Summary: The size of a grid for layout stuff
		 */
		static const int GRID_SIZE = 8;

		/**
		 * Summary: Constructs a window
		 *
		 * Arguments:
		 * 	x: The x coordinate of the top-left corner of the window
		 * 	y: The y coordinate of the top-left corner of the window
		 *  width: The width of the window
		 *  height: The height of the window
		 */
		Window(int x, int y, int width, int height);

		/**
		 * Summary: Destroys a window
		 */
		virtual ~Window();

		/**
		 * Summary: Returns the x coordinate of the top-left corner of the window
		 *
		 * Return: The x coordinate of the top-left corner of the window
		 */
		int getX() const;

		/**
		 * Summary: Returns the y coordinate of the top-left corner of the window
		 *
		 * Return: The y coordinate of the top-left corner of the window
		 */
		int getY() const;

		/**
		 * Summary: Returns the height of the window
		 *
		 * Return: The width of the window
		 */
		int getWidth() const;

		/**
		 * Summary: Returns the width of the window
		 *
		 * Return: The height of the window
		 */
		int getHeight() const;

		/**
		 * Summary: Returns whether or not the window is visible
		 *
		 * Return: Whether or not the window is visible
		 */
		bool isVisible() const;

		/**
		 * Summary: Sets the location of the window
		 *
		 * Arguments:
		 * 	newX: The new x coordinate of the top-left corner of the window
		 * 	newY: The new y coordinate of the top-left corner of the window
		 */
		void setLocation(int newX, int newY);

		/**
		 * Summary: Sets the size of the window
		 *
		 * Arguments:
		 * 	newWidth: The new width of the window
		 * 	newHeight: The new height of the window
		 */
		void setSize(int newWidth, int newHeight);

		/**
		 * Summary: Sets the visibility the window
		 *
		 * Arguments:
		 * 	newVisible: The visibility to set the window to
		 */
		void setVisible(bool newVisible);

		/**
		 * Summary: Draws the window
		 */
		void draw();

		/**
		 * Summary: Handles an event
		 *
		 * Arguments:
		 * 	event: The event to handle
		 */
		virtual void handleEvent(SDL_Event* event) = 0;

	protected:
		/**
		 * 	Summary: The x coordinate of the top-left corner of the window
		 */
		int x;

		/**
		 * 	Summary: The y coordinate of the top-left corner of the window
		 */
		int y;

		/**
		 *  Summary: The width of the window
		 */
		int width;

		/**
		 *  Summary: The height of the window
		 */
		int height;

		/**
		 * Summary: The visibility of the window
		 */
		bool visible;

		/**
		 * Summary: Draws the content of the window
		 */
		virtual void drawContent() = 0;
};

#endif
